<?php
class Application_Form_Resultat extends Zend_Form
{
	
	public function init()
	{
		echo $this->_position;
		$piloteDAO = new Application_Model_PiloteDAO();
		$pilotes = $piloteDAO->findAll();
		$pilotetab = array();
		foreach($pilotes as $pilote)
		{
			$pilotetab[$pilote->getPilNum()] = $pilote->getPilNom();
		}
		
		$decorators = array(
		    'ViewHelper',
		    'Errors',
		    array('HtmlTag', array('tag' => 'td'))
		);
		
		$position = new Application_Form_Element_Note(
		    'position',
		    array('value' => '',
		    		'decorators' => $decorators)		    
		);
		$this->addElement($position);
		
		$this->addElement(
			'select', 'pilnum',
		    array('MultiOptions' => $pilotetab,
		    'decorators' => $decorators,
		    'required' => true
		    )
		); 
		
		$this->addElement(
			'text', 'tempscourse',
		    array(
		    'decorators' => $decorators,
		    'validators' => array(array('regex', false, array('pattern' => '/^[0-9]{2}:[0-9]{2}:[0-9]{2}/i'))),
		    'required' => true
		    )
		);
		
		$this->addElement(
			'submit', 'Ok',
		    array(
		    'decorators' => $decorators
		    )
		);
		
		$this->setDecorators(
		    array(
		        'FormElements',
		        array('HtmlTag', array('tag' =>  'tr')),
		        'Form'
		    )
		);
	}
}

